<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Assets/Hui/lib/html5.js"></script>
<script type="text/javascript" src="/Public/Assets/Hui/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/Assets/Hui/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/Assets/Hui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Assets/Hui/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="/Public/Assets/Hui/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>会员登录</title>

<link rel="stylesheet" type="text/css" href="/Public/Assets/Hui/lib/validator/jquery.validator.css" />
<link rel="stylesheet" type="text/css" href="/Public/Assets/Hui/lib/icheck/icheck.css" />
<style>

</style>

<link rel="stylesheet" type="text/css" href="/Public/Static/Css/user.css" />
</head>
<body id="user-base">

<div class="container clearfix">
	<div id="content-container">
		<div class="login-section" id="tab_login" class="HuiTab">
			  <div class="login-tab cl"><a class="current">登录账号</a><a href="<?php echo U('register/index');?>">注册账户</a></div>
			  <div class="login-con">
			  <form action="<?php echo U('Login/login_post');?>" method="post" class="validator_form">
			  	<div class="control-group mb-20">
			  		<label class="formlabel" for="">账号</label>
					<div class="formControls">
						<input type="text" class="input-text radius  size-L" value="" placeholder="用户名/手机/邮箱"  name="username" data-rule="账号:required;">
					</div>
			  	</div>
			  	<div class="control-group mb-30">
			  		<label class="formlabel" for="">密码</label>
					<div class="formControls">
						<input type="password" class="input-text radius  size-L" value="" placeholder="密码"  name="pwd" data-rule="密码:required;">
					</div>
			  	</div>
			  	<div class="control-group mb-20">
			  		<div id="div_id_embed"></div>
			  	</div>
			  	<div class="control-group mb-20">
					<div class="formControls">
						<label><input type="checkbox" name="_remember_me" checked="checked">记住密码</label>
					</div>
			  	</div>
			  	<div class="control-group mb-20">
			  		<div class="formControls">
			  			<input class="btn btn-primary btn-block radius size-L" type="submit" value="登录">
			  		</div>
			  	</div>
			  	</form>
			  	<div class="mb-20"><a href="<?php echo U('resetpwd/index');?>">找回密码</a><span class="pipe">|</span><span>还没有注册账号?</span><a href="<?php echo U('register/index');?>">立即注册</a></div>
			  	<div class="control-group mb-40 text-c connect">
			  		<?php if(C('REGISTER_SWITCH')): if(!C('INVITATION_SWITCH')): echo W('Connect/index'); endif; endif; ?>
			  	</div>
			  </div>
		</div>
	</div>
</div>

<script type="text/javascript" src="/Public/Assets/Hui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Assets/Hui/js/H-ui.js"></script> 

<script type="text/javascript" src="/Public/Assets/Hui/lib/validator/jquery.validator.js"></script>
<script type="text/javascript" src="/Public/Assets/Hui/lib/validator/local/zh_CN.js"></script>
<script type="text/javascript" src="/Public/Assets/Hui/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="/Public/Sea/modules/layer/2.1/layer/layer.js"></script>
<script type="text/javascript" src="https://api.geetest.com/get.php"></script>
<script>
window.embed_captcha = new window.Geetest({
    gt: '0d3be416079da49e718b40a06a1acba9',
    product: 'float'
}).appendTo("#div_id_embed");

$('.validator_form').validator({
	msgClass: "n-bottom", 
	msgIcon:"",
    valid: function(form){
    	var me = this;
    	//防止重复提交表单
        me.holdSubmit();
        var ii = layer.msg('数据处理中...', {icon: 16,time: 10000}, function(){
	   	    layer.alert('服务器响应超时', {icon: 7});
	   	});
        
		$.ajax({
	        url:  $(form).attr('action'),
	        data: $(form).serialize(),
	        type: "POST",
	        dataType:"json",
	        success: function(data){
	        	layer.close(ii);
	        	//data = JSON.parse(data);  //str 转 json
	        	if (data.status) {
	        		layer.msg(data.info, {icon: 1,time:1000});
	            }else{
	            	layer.msg(data.info, {icon: 2,time:1000});
	            	
	            }

	        	//需要跳转的话
	        	if(data.url){
	               	setTimeout(function(){
	               		location.href= data.url;
	               	},1000);
	            }else{
	            	embed_captcha.refresh();
	            }
	        	
	        	//信息提示框结束之后，表单可提交
	        	setTimeout(function(){
	        		me.holdSubmit(false);
	             },1000);
	        	
	        }
	    });
	}
});
</script>

</body>
</html>